//zdp
//功能：获得门的信息
//用法：
//[Inject]
//public var daw:DoorsAndWindows;
//daw。doors为门的数列，daw.roomindex为门对应的所在房间序号数列
//daw.doors[w].globalpos为门的位置，point型，x是x，y是z
//daw.doors[w].globalangle为门的角度
//daw.doors[w].width为门宽

package com.tongji.diy.model
{
	import com.tongji.diy.event.GetDoors;
	import com.tongji.diy.view.component3D.Door;
	
	import org.robotlegs.mvcs.Actor;
	
	
	
	[Bindable]
	public class DoorsAndWindows extends Actor
	{
		private var _width:int = 90;
		
		private var _doors:Vector.<Door> = new Vector.<Door>();
		private var _roomindex:Vector.<int> = new Vector.<int>();
		public function getwidth():int
		{
			return _width;
		}
		public function get doors():Vector.<Door>
		{
			refreshinfo();
			return _doors;
		}
		public function get roomindex():Vector.<int>
		{
			refreshinfo();
			return _roomindex;
		}
		public function refreshinfo():void
		{
			//trace("do");
			dispatch(new GetDoors(GetDoors.GETDOORS));
		}
		public function refreshinfofromscene(s_doors:Vector.<Door>,s_rooms:Vector.<int>):void
		{
			_doors.length = 0;
			_roomindex.length = 0;
			for(var i:int = 0;i<s_doors.length;i++)
			{
				_doors.push(s_doors[i]);
				_roomindex.push(s_rooms[i]);
			}
			//trace("done");
		}
		
	}
}